/*
 * toolbox.c
 *
 *  Created on: Jun 4, 2010
 *      Author: Armen Nazarian
 */

#include <includes.h>
#include "toolbox.h"

void convertToBinaryFunctionAndDisplay(INT8U num) {
	turn_all_diodes_off();
	int i;

	for (i = 1; i <= 8; i++) {

		if ((num & (1 << (i - 1))) == 0) {
			LED_Off(i);
		} else {
			LED_On(i);
		}
	}

}

void turn_all_diodes_off() {
	int i;
	for (i = 1; i <= 8; i++) {
		LED_Off(i);
	}
}


